package nimbus.utils
{
	
	public function applyInstantiation(classObject:Class, params:Array):Object
	{
		var instance:Object;
		switch(params.length)
		{
			case 0 : instance = new classObject(); break;
			case 1 : instance = new classObject(params[0]); break;
			case 2 : instance = new classObject(params[0], params[1]); break;
			case 3 : instance = new classObject(params[0], params[1], params[2]); break;
			case 4 : instance = new classObject(params[0], params[1], params[2], params[3]); break;
			case 5 : instance = new classObject(params[0], params[1], params[2], params[3], params[4]); break;
			case 6 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5]); break;
			case 7 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6]); break;
			case 8 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]); break;
			case 9 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8]); break;
			case 10 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9]); break;
			case 11 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]); break;
			case 12 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11]); break;
			case 13 : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12]); break;
			default : instance = new classObject(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10], params[11], params[12], params[13]); break;
		}
		
		return instance;
	}
	
}
